<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/dongxing/flower/Flower.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/dongxing/flower/Flower.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Id',
                footer: "Foots",
                cnName: '鲜花列表',
                name: 'flower/Flower',
                url: "/Flower/",
                sortName: "Title"
            });
            const editFormFields = ref({"Title":"","Type":"","Image":"","BigImage":"","Description":"","Price":"","Language":"","Material":"","Packing":"","DeliveryRemarks":""});
            const editFormOptions = ref([[{"dataKey":"鲜花类型","data":[],"title":"类型","field":"Type","type":"select"},
                               {"title":"鲜花名","required":true,"field":"Title"}],
                              [{"title":"图片","required":true,"field":"Image","type":"img"},
                               {"title":"大图","required":true,"field":"BigImage","type":"img"}],
                              [{"title":"描述","required":true,"field":"Description"},
                               {"title":"价格","required":true,"field":"Price","type":"decimal"}],
                              [{"title":"花语","required":true,"field":"Language"},
                               {"title":"材料","required":true,"field":"Material"}],
                              [{"title":"包装","required":true,"field":"Packing"},
                               {"title":"配送说明","required":true,"field":"DeliveryRemarks"}]]);
            const searchFormFields = ref({"Title":"","Type":[],"Price":"","DeliveryRemarks":""});
            const searchFormOptions = ref([[{"title":"鲜花名","field":"Title","type":"like"},{"dataKey":"鲜花类型","data":[],"title":"类型","field":"Type","type":"selectList"},{"title":"价格","field":"Price","type":"datetime"},{"title":"配送说明","field":"DeliveryRemarks","type":"like"}]]);
            const columns = ref([{field:'Id',title:'Id',type:'long',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'Title',title:'鲜花名',type:'string',link:true,width:180,require:true,align:'left',sort:true},
                       {field:'Type',title:'类型',type:'int',bind:{ key:'鲜花类型',data:[]},width:110,align:'left'},
                       {field:'Image',title:'图片',type:'img',width:180,require:true,align:'left'},
                       {field:'BigImage',title:'大图',type:'img',width:180,require:true,align:'left'},
                       {field:'Description',title:'描述',type:'string',width:180,require:true,align:'left'},
                       {field:'Price',title:'价格',type:'decimal',width:110,require:true,align:'left'},
                       {field:'Language',title:'花语',type:'string',width:180,require:true,align:'left'},
                       {field:'Material',title:'材料',type:'string',width:180,require:true,align:'left'},
                       {field:'Packing',title:'包装',type:'string',width:180,require:true,align:'left'},
                       {field:'DeliveryRemarks',title:'配送说明',type:'string',width:180,require:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
